package sky.ikaros.android_log;

import android.app.Activity;
import android.os.Bundle;
import android.widget.Button;

import androidx.annotation.Nullable;

import java.util.UUID;

import sky.ikaros.android_plugin_log.AndroidLogLevel;
import sky.ikaros.android_plugin_log.AndroidPluginLog;
import sky.ikaros.android_plugin_log.AndroidPluginLogFactory;

public class ActivityMain extends Activity {
    AndroidPluginLog log;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        log = AndroidPluginLogFactory.getLogger();
        log.register(this, true, AndroidLogLevel.TRACE);
        log.d("ActivityMain", "ActivityMain Message " + UUID.randomUUID(), null);
        log.d("ActivityMain", "ActivityMain Message2 " + UUID.randomUUID(), null);
        Button button = findViewById(R.id.button);
        button.setOnClickListener(view->{
            log.t("ActivityMain", "ActivityMain Message " + UUID.randomUUID());
            log.d("ActivityMain", "ActivityMain Message " + UUID.randomUUID());
            log.w("ActivityMain", "ActivityMain Message " + UUID.randomUUID());
            log.i("ActivityMain", "ActivityMain Message " + UUID.randomUUID());
            log.e("ActivityMain", "ActivityMain Message " + UUID.randomUUID());
        });
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        log.release();
    }
}
